<div class="breadcrumbs" id="breadcrumbs">
	<script type="text/javascript">
		try {
			ace.settings.check('breadcrumbs', 'fixed')
		} catch (e) {
		}
	</script>

	<ul class="breadcrumb">
		<li><i class="icon-home home-icon"></i> <a href="#">首页</a></li>
		<li><a href="#">资源管理</a></li>
		<li class="active">资源列表</li>
	</ul>
</div>
<div class="page-content">
	<div class="page-header">
		<h1>资源列表</h1>
	</div><!-- end /.page-header -->
	
	<div class="row">
		<div class="col-xs-14">
			<table id="grid-table"></table>
			<div id="grid-pager"></div>
			<script type="text/javascript">
				var $path_base="${basePath}" 	//this will be userd in gritter alerts containing images
			</script>
		</div><!-- end /.col -->
	</div><!-- end /.row -->
</div><!-- end /.page-content -->
<script type="text/javascript">
	jQuery(function($){
		var grid_selector = "#grid-table";
		var pager_selector = "#grid-pager";
		jQuery(grid_selector).jqGrid({
			url : '${basePath}/action/list',
			datatype: 'json',
			mytype : 'POST',
			height: 400,
			colNames:['编号',' 名称','上级资源','上级资源','URL','唯一值','排序','是否有效','操作'],
			colModel:[
			          {name:'id',index:'id',width:30,sorttype:"int",editable:false},
			          {name:'name',index:'name',width:150,sorttype:"text",editable:true,editrules:{required:true}},
			          {name:'parentId',index:'parentId',hidden:true,sortable:true,width:50,sorttype:"int",
			        	  editable:true,edittype:"select",editoptions:{value:'${actionKeyValue}'},editrules:{edithidden:true},
			        	  search:true,stype:"select",searchoptions:{value:'${actionKeyValue}',searchhidden:true}},
			          {name:'parentName',index:'parentName',sortable:false,width:100,editable:false,search:false},
			          {name:'url',index:'url',sortable:false,width:80,editable:true,editrules:{required:true},search: true},
			          {name:'value',index:'value',sortable:true,width:150,editable:true,editrules:{required:true},search:false},
			          {name:'order',index:'order',width:30,editable:true,editrules:{required:true,integer:true},search:false},
			          {name:'status',index:'status',sorttype:"int",
			        	  formatter:function(cellvalue,options,rowObject){if(cellvalue==1){return "是";}if(cellvalue==0){return "否";}},
			        	  edittype:"select",editoptions:{value:'1:是;0:否'}, width:40,editable:true,search:false},
			          {name:'myac',index:'',width:80, fixed:true, sortable:false,resize:false,
			        	  formatter:'actions',
			        	  formatoptions:{
			        		  keys:false,
			        		  delOptions:{recreateForm:true, beforeShowForm:beforeDeleteCallback},
							  editformbutton:true, editOptions:{recreateForm: true, beforeShowForm:beforeEditCallback,closeAfterEdit: true}
			        	  },
						  search:false,viewable:false}
			          ],
			         	jsonReader:{repeatitems:false},
			          	viewrecords : true,
						rowNum:10,
						rowList:[10,20,30,50,100,1000],
						pager : pager_selector,
						altRows: true,
						loadtext:'正在加载数据...',
						multiselect: true,
				        multiboxonly: true,
				        loadComplete:function(){
				        	var table = this;
				        	setTimeout(function(){
								updatePagerIcons(table);
								enableTooltips(table);
				        	},0);
				        },
				        editurl:"${basePath}/action/cud",
				        caption:"资源列表",
				        autowidth:true
		});
		//引入jqgrid通用js 脚本
		<#include "/WEB-INF/common/_jqGrid.html"/>
		
	});
</script>